home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / recent / mcf4amrc.lha / MCF4AmIRC / Rexx / MCF_SOUND.AMIRX < prev    next >
Text File  |  1996-12-26  |  3KB  |  10 lines

  1. /* MCF_SOUND.AMIRX
  2. // $VER: MCF_SOUND.AMIRX 4.13 (26.12.96)
  3. \\ Written by Donald T. Becker (dtbecker@prolog.net) IRC: StarDustr
  4. // Please mail any bug reports/comments to the above address with a subject
  5. \\ header of MCF.AMIRX.
  6. //
  7. \\ ** What to do with this file?
  8. // Put this script in REXX:        It will be used by MCF.AMIRX.
  9. */
  10. ;parse arg MCFenv Unick junk wavfile ploop plcnt morejunk;xx=pos('01'x,wavfile);if xx>0 then;wavfile=strip(left(wavfile,xx-1),"B");if wavfile="" then exit;Spos=lastpos('\',wavfile);if Spos ~=0 then wavfile=substr(wavfile,Spos+1);Cpos=lastpos(':',wavfile);if Cpos ~=0 then wavfile=substr(wavfile,Cpos+1);address value(MCFenv);xl=pos(".",MCFenv)+1;Client=substr(MCFenv,xl);SDC="SOUNDDIR."||client;SoundDir=getclip(SDC);FN=strip(SoundDir||wavfile);if FN="" then exit;SPC="SOUNDPLAYER."||Client;SoundPlayer=getclip(SPC);clipname="NOSOUNDS."||Client;response=getclip(clipname);DSclip="DCCSOUNDS."||Client;DSrc=getclip(DSclip);ASclip="DCCGET."||Client;ASrc=getclip(ASclip);plcmds="";if upper(ploop)='L'&plcnt>0&plcnt<6 then plcmds=ploop plcnt;parse value statef(FN) with Fstate junk;if Fstate="FILE" then;do;if response<5 then;do;"echo P="d2c(27)"««MCF»  "d2c(2)Unick d2c(2)"requests that you play"d2c(2) wavfile".";address command SoundPlayer ">nil:" FN plcmds;call setclip(wavfile,"");end;exit;end;if response>4 then response=response-5;if ASrc='Y' then;CValue=upper(Unick);else CValue='Y';options results;getmynick;MyNick=upper(result);ToNick=upper(Unick);if MyNick=ToNick then response=2;select;when response=4 then;do;if "" ~=getclip(wavfile) then exit;call FindUser();wavfile=upper(wavfile);call setclip(wavfile,CValue);call setclip(DSclip, DSrc||" "||wavfile);end;when response=3 then;do;if "" ~=getclip(wavfile) then exit;"RAW PRIVMSG "Unick" :"||'01'x||"GETSOUND "wavfile||'01'x;wavfile=upper(wavfile);call setclip(wavfile,"CValue");call setclip(DSclip, DSrc||" "||wavfile);end;when response=2 then "echo P="d2c(27)"««MCF» Sound file"d2c(2) wavfile d2c(2)"not found!";when response=1 then "RAW NOTICE "Unick" :Sound file"d2c(2) wavfile d2c(2)"not found!";otherwise exit;end;exit;FindUser:;channels;ChList=upper(result);if ChList="" then return;do ccnt=1 by 1 until ChList="";parse value ChList with chan ChList;end ccnt;xcnt=0;do chcnt=1 by 1 until xcnt=ccnt;drop result;getchannel chcnt;chan=result;if chan="RESULT" then iterate chcnt;xcnt=xcnt+1;getusers chcnt;ChUs=" "||upper(result)||" ";if 0=pos(ToNick,ChUs) then iterate;"RAW PRIVMSG "chan" :!"Unick wavfile;xcnt=ccnt;end chcnt;return